//
//  SPConstants.h
//  ShandongPoker
//
//  Created by Developer on 2025-01-08.
//  Copyright © 2025 ShandongPoker. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

#pragma mark - 游戏常量

/// 最大玩家数量
FOUNDATION_EXPORT const NSInteger SP_MAX_PLAYERS;

/// 最小玩家数量
FOUNDATION_EXPORT const NSInteger SP_MIN_PLAYERS;

/// 每个玩家的手牌数量
FOUNDATION_EXPORT const NSInteger SP_CARDS_PER_PLAYER;

/// 公共牌数量
FOUNDATION_EXPORT const NSInteger SP_COMMUNITY_CARDS_COUNT;

/// 默认起始筹码
FOUNDATION_EXPORT const NSInteger SP_DEFAULT_STARTING_CHIPS;

#pragma mark - UI常量

/// 基础间距单位
FOUNDATION_EXPORT const CGFloat SP_BASE_SPACING;

/// 最小触摸区域
FOUNDATION_EXPORT const CGFloat SP_MIN_TOUCH_SIZE;

/// 扑克牌标准宽度
FOUNDATION_EXPORT const CGFloat SP_CARD_WIDTH;

/// 扑克牌标准高度
FOUNDATION_EXPORT const CGFloat SP_CARD_HEIGHT;

/// 扑克牌圆角半径
FOUNDATION_EXPORT const CGFloat SP_CARD_CORNER_RADIUS;

/// 按钮标准高度
FOUNDATION_EXPORT const CGFloat SP_BUTTON_HEIGHT;

/// 按钮圆角半径
FOUNDATION_EXPORT const CGFloat SP_BUTTON_CORNER_RADIUS;

#pragma mark - 动画常量

/// 快速动画时长
FOUNDATION_EXPORT const NSTimeInterval SP_ANIMATION_DURATION_FAST;

/// 标准动画时长
FOUNDATION_EXPORT const NSTimeInterval SP_ANIMATION_DURATION_NORMAL;

/// 慢速动画时长
FOUNDATION_EXPORT const NSTimeInterval SP_ANIMATION_DURATION_SLOW;

/// 发牌动画时长
FOUNDATION_EXPORT const NSTimeInterval SP_DEAL_ANIMATION_DURATION;

#pragma mark - 通知名称

/// 游戏状态改变通知
FOUNDATION_EXPORT NSString * const SPGameStateDidChangeNotification;

/// 玩家动作通知
FOUNDATION_EXPORT NSString * const SPPlayerActionNotification;

/// 游戏结束通知
FOUNDATION_EXPORT NSString * const SPGameDidEndNotification;

/// 筹码变化通知
FOUNDATION_EXPORT NSString * const SPChipsDidChangeNotification;

#pragma mark - UserDefaults Keys

/// 用户设置键
FOUNDATION_EXPORT NSString * const SP_USER_SETTINGS_KEY;

/// 游戏统计键
FOUNDATION_EXPORT NSString * const SP_GAME_STATISTICS_KEY;

/// 音效设置键
FOUNDATION_EXPORT NSString * const SP_SOUND_ENABLED_KEY;

/// 音乐设置键
FOUNDATION_EXPORT NSString * const SP_MUSIC_ENABLED_KEY;

/// 震动设置键
FOUNDATION_EXPORT NSString * const SP_VIBRATION_ENABLED_KEY;

#pragma mark - 错误域

/// 游戏错误域
FOUNDATION_EXPORT NSString * const SPGameErrorDomain;

/// 网络错误域
FOUNDATION_EXPORT NSString * const SPNetworkErrorDomain;

/// 数据错误域
FOUNDATION_EXPORT NSString * const SPDataErrorDomain;

#pragma mark - 枚举定义

/// 扑克牌花色
typedef NS_ENUM(NSInteger, SPCardSuit) {
    SPCardSuitSpades = 0,    // 黑桃 ♠
    SPCardSuitHearts,        // 红桃 ♥
    SPCardSuitDiamonds,      // 方块 ♦
    SPCardSuitClubs          // 梅花 ♣
};

/// 扑克牌点数
typedef NS_ENUM(NSInteger, SPCardRank) {
    SPCardRankTwo = 2,
    SPCardRankThree,
    SPCardRankFour,
    SPCardRankFive,
    SPCardRankSix,
    SPCardRankSeven,
    SPCardRankEight,
    SPCardRankNine,
    SPCardRankTen,
    SPCardRankJack,
    SPCardRankQueen,
    SPCardRankKing,
    SPCardRankAce
};

/// 游戏状态
typedef NS_ENUM(NSInteger, SPGameState) {
    SPGameStateIdle = 0,     // 空闲状态
    SPGameStateDealing,      // 发牌中
    SPGameStatePreFlop,      // 翻牌前
    SPGameStateFlop,         // 翻牌
    SPGameStateTurn,         // 转牌
    SPGameStateRiver,        // 河牌
    SPGameStateShowdown,     // 摊牌
    SPGameStateEnded         // 游戏结束
};

/// 玩家动作
typedef NS_ENUM(NSInteger, SPPlayerAction) {
    SPPlayerActionFold = 0,  // 弃牌
    SPPlayerActionCheck,     // 过牌
    SPPlayerActionCall,      // 跟注
    SPPlayerActionRaise,     // 加注
    SPPlayerActionAllIn      // 全下
};

/// 牌型
typedef NS_ENUM(NSInteger, SPHandRank) {
    SPHandRankHighCard = 0,      // 高牌
    SPHandRankOnePair,           // 一对
    SPHandRankTwoPair,           // 两对
    SPHandRankThreeOfAKind,      // 三条
    SPHandRankStraight,          // 顺子
    SPHandRankFlush,             // 同花
    SPHandRankFullHouse,         // 葫芦
    SPHandRankFourOfAKind,       // 四条
    SPHandRankStraightFlush,     // 同花顺
    SPHandRankRoyalFlush         // 皇家同花顺
};

/// AI难度
typedef NS_ENUM(NSInteger, SPAIDifficulty) {
    SPAIDifficultyEasy = 0,      // 简单
    SPAIDifficultyMedium,        // 中等
    SPAIDifficultyHard           // 困难
};

/// NPC策略类型
typedef NS_ENUM(NSInteger, SPNPCStrategyType) {
    SPNPCStrategyTypeConservative = 0,  // 保守型
    SPNPCStrategyTypeAggressive,        // 激进型
    SPNPCStrategyTypeExperienced        // 老练型
};

NS_ASSUME_NONNULL_END